package net.rossillo.spring.web.servlet.mvc;

import net.rossillo.spring.context.support.FacebookSessionException;
import net.rossillo.spring.web.servlet.http.FacebookHttpServletRequest;

/**
 * Provides common controller utility methods necessary since 
 * Facebook controllers easily share a super class.
 * 
 * @author Scott Rossillo
 *
 */
final class FacebookToolkit {
	
	public static void requireSession(FacebookHttpServletRequest request) throws FacebookSessionException {
		
		String authToken = request.getAuthToken();
		String sessionKey = request.getSessionKey();
		
		if(authToken == null && sessionKey == null) {
			throw new FacebookSessionException("Facebook session not found!");
		}
		
	}
	

	private FacebookToolkit() { }
}
